﻿<%@ Page Title="" Language="C#" MasterPageFile="~/controlasistencia/Plantilla.Master" AutoEventWireup="true" CodeBehind="reporteMensualComision.aspx.cs" Inherits="Presentacion.controlasistencia.reporteMensualComision" EnableEventValidation="false" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" type="text/css" href="css/loaders.css" />
    <script>    
        $(document).ready(function () {
            $(document).on("click", ".loading", function () {
                $("#loader").modal('show');
            })
        }); function sucessMessage(success) {

            Messenger.options = {
                extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right',
                theme: 'flat'
            }

            Messenger().post({
                message: success,
                type: 'success',
                showCloseButton: true
            });
        }

        function errorMessage(errorMessage) {

            Messenger.options = {
                extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right',
                theme: 'flat'
            }

            Messenger().post({
                message: errorMessage,
                type: 'error',
                showCloseButton: true
            });
        }
        function setearmes() {
            var opcion_seleccionada = $("#ddlReporteMeses option:selected").text();
            document.getElementById("hdMes").value = opcion_seleccionada;

        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contenido" runat="server">
    <form runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnableViewState="true"></asp:ScriptManager>
        <asp:HiddenField ID="hdMes" runat="server" ClientIDMode="Static" />
        <div class="row">
            <div class="col-lg-12">
                <div class="page-title">
                    <h2>Reportes mensual de registro de asistencias
                        <small>
                            <asp:Label ID="lblCarrera" runat="server" Text=""></asp:Label></small>
                    </h2>
                    <ol class="breadcrumb">
                        <li><i class="fa"></i><a href="index.aspx" class="tamano-breadcrumbs">Inicio</a>
                        </li>
                        <li class="active tamano-breadcrumbs">Reportes Comisión académica</li>
                    </ol>
                </div>
            </div>
        </div>
        <div class="row">

            <div class="col-lg-12">

                <div class="portlet portlet-green">
                    <div class="portlet-heading">
                        <div class="portlet-title">
                            <h4>Reporte </h4>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="portlet-body">
                        <div class="clearfix"></div>
                        <div class="col-lg-12">   
                            <div class="col-lg-4">   
                                <p> 
                                    Periodo
                                </p>
                                <asp:DropDownList ID="ddlPeriodo" runat="server" ClientIDMode="Static" CssClass="form-control" onchange="traerMeses()"></asp:DropDownList>
                            </div>
                            <div class="col-lg-3">
                                <p>Mes</p>
                                <select id="ddlReporteMeses" class="form-control" name="ddlReporteMeses" onchange="setearmes()">
                                </select>
                            </div>
                            <div class="col-lg-3">
                                <p>Carrera</p>
                                <asp:DropDownList ID="ddlCarrera" runat="server" ClientIDMode="Static" CssClass="form-control"></asp:DropDownList>
                            </div>
                            <div class="col-lg-2">
                                <p>Semestre</p>
                                <asp:DropDownList ID="ddlSemestre" runat="server" ClientIDMode="Static" CssClass="form-control">
                                    <asp:ListItem Text="Primer" Value="1" />
                                    <asp:ListItem Text="Segundo" Value="2" />
                                    <asp:ListItem Text="Terce" Value="3" />
                                    <asp:ListItem Text="Cuarto" Value="4" />
                                    <asp:ListItem Text="Quinto" Value="5" />
                                    <asp:ListItem Text="Sexto" Value="6" />
                                    <asp:ListItem Text="Séptimo" Value="7" />
                                    <asp:ListItem Text="Octavo" Value="8" />
                                    <asp:ListItem Text="Noveno" Value="9" />
                                    <asp:ListItem Text="Décimo" Value="10" />
                                </asp:DropDownList>
                            </div>
                            <div class="col-lg-4">
                                <p>&nbsp    </p>
                                <asp:LinkButton ID="generar" runat="server" CssClass="btn btn-green loading" OnClick="generar_Click"><i class="fa fa-building-o"></i> Generar Reporte</asp:LinkButton>
                            </div>

                        </div>
                        <p>&nbsp</p>
                        <p>&nbsp</p>
                        <div class="table-responsive col-sm-12 col-lg-12" id="report">
                            <div class="col-lg-2">
                            </div>
                            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%" AsyncRendering="False" CssClass="table-responsive" Visible="False" SizeToReportContent="True">
                                <LocalReport ReportEmbeddedResource="Presentacion.controlasistencia.reports.ReportComisionMensual.rdlc">
                                    <DataSources>
                                        <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="dtsComisionMensual" />
                                    </DataSources>
                                </LocalReport>
                            </rsweb:ReportViewer>
                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="consultarReporteMensualRegistro" TypeName="Negocio.catalogos.catalogoReporte, Negocio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="" Name="semestre" Type="Int32"></asp:Parameter>
                                    <asp:Parameter DefaultValue="" Name="paralelo" Type="string"></asp:Parameter>
                                    <asp:Parameter DefaultValue="" Name="carrera" Type="string"></asp:Parameter>
                                    <asp:Parameter DefaultValue="" Name="periodo" Type="string"></asp:Parameter>
                                    <asp:Parameter DefaultValue="" Name="mes" Type="string"></asp:Parameter>
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </div>
                    </div>
                </div>
                <!-- /.portlet -->

            </div>
        </div>
        <div class="modal fade" id="loader" tabindex="-1" role="dialog" aria-labelledby="flexModalLabel" aria-hidden="true">
            <div style="height: 50%;"></div>
            <div class="col-lg-12">
                <div class="col-lg-5">
                </div>
                <div class="col-lg-2" style="left: 5%;">
                    <div class="loader" style="width: inherit; height: inherit;">
                        <div class="loader-inner ball-spin-fade-loader">
                            <div></div>
                            <div></div>
                            <div></div>
                            <div></div>
                            <div></div>
                            <div></div>
                            <div></div>
                            <div></div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-5">
                </div>
            </div>
        </div>
        <script>    

            function traerMeses() {
                var idPeriodo = 0;
                idPeriodo = $("#ddlPeriodo").val();
                var conexion;
                if (window.XMLHttpRequest) {
                    conexion = new XMLHttpRequest;
                }
                else {
                    conexion = new ActiveXObject("Microsoft.XMLHTTP");
                }
                conexion.onreadystatechange = function () {
                    if (conexion.readyState == 4 && conexion.status == 200) {
                        $("#ddlReporteMeses").empty();
                        $("#ddlReporteMeses").append("<option value='0'>Seleccione el mes</option>");
                        $("#ddlReporteMeses").append(conexion.responseText);
                    }
                }
                conexion.open("GET", "mesesAnios.aspx?id=" + idPeriodo, true);
                conexion.send();
            }
        </script>
    </form>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
</asp:Content>
